<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body></body>
  <script>
    //作用域链
    //写在函数里的var 是函数租用与
    //内部函数可以访问外部函数的变量,所以当访问一个本函数内不存在的值的时候就会沿着
    //作用域链一层一层向函数外城查找,如果一直查找不到,那不就是udefined

    var user = {
      name: "张三",
      age: 11,
      address: "淄博",
    };
    console.log(user.name);
    function Star(name, age, gender) {
      this.name = name;
      this.age = age;
      this.gender = gender;
    }
    var star = new Star("刘德华", 22, "男");
    console.log(star.name);

    var date = new Date();
    new Date("2020-11-11 11:11:11");

    //获得毫秒时间
    var time = date.getTime();
    console.log(time);
  </script>
</html>
